const Router = require('koa-router')

const route = new Router()

// 首页
route.get('/', async (ctx) => {
    let data = {
        isLogin: ctx.session.user === true,
        title: '程序员的博客'
    }

    await ctx.render('index', data)
})
// 登录

route.get('/login', async (ctx) => {
    let data = {
        title: '登录',
        msg: ''
    }
    await ctx.render('login', data)
})

// 文章详情
route.get('/articleInfo', async (ctx) => {
    let data = {
        isLogin: false,
        title: '文章详情'
    }
    await ctx.render('article-info', data)
})

// 文章编辑页面
route.get('/articleEdit', async (ctx) => {
    let data = {
        isLogin: false,
        title: '文章编辑页面'
    }
    await ctx.render('article-edit', data)
})

module.exports = route
